<!--  -->
<template>
  <div>
    <van-popup v-model="deductShow" position="bottom" closeable round @close="deductClose">
      <div class="deduct-main">
        <div class="deduct-title">扣款记录</div>
        <div class="pledge-list" v-if="deductionData.length > 0">
          <block v-for="(item,index) in deductionData" :key="index">
            <div class="pledge-item">
              <div class="dleage-odd flex-a-c flex-j-sb">
                <h3>{{item.order_sn}}</h3>
                <span :class="item.status_name === '进行中'?'red':''">{{item.status_name}}</span>
              </div>
              <div class="dleage-time flex-a-c flex-j-sb">
                <p>第{{item.cycle}}月 {{item.amount || '0.00'}}</p>
                <span>{{item.created_at}}</span>
              </div>
            </div>
          </block>
        </div>
        <van-empty description="暂无记录" v-else />
        <div  :class="[fun.isIphoneX() ? 'pledge-bottom' : '']"></div>
      </div>
    </van-popup>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
name:'',
model: {
    prop: 'deductShow',
    event: 'deductOpen'
},
props: {
  deductShow: Boolean,
  deductionData:{
    type:Array,
    default:() => []
  }
},
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
return {
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
  deductClose(data) {
    this.$emit('deductOpen', false);
  }
},
//生命周期 - 创建完成（可以访问当前this实例）
created() {

},
//生命周期 - 挂载完成（可以访问DOM元素）
mounted() {

},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang="scss" scoped>
/* @import url(); 引入公共css类 */
.deduct-main {
  .deduct-title {
    text-align: center;
    font-size: 15px;
    color: #333;
    padding: 18px 0;
  }

  .pledge-list {
    height: 350px;
    overflow-y: scroll;
    background-color: #fff;
    border-radius: 4px;
    // padding:0px 12px 0 12px;
    margin: 0 12px;

    :last-child {
      .pledge-item {
        border-bottom: none;
      }
    }

    .pledge-item {
      padding: 12px 0;
      border-bottom: 1px solid #f0f0f1;

      .dleage-odd {
        padding: 0 0 6px 0;

        h3 {
          font-size: 16px;
          color: #333;
          font-weight: 400;
        }

        span {
          font-size: 14px;
          color: #3b3b4a;
        }

        .red {
          color: #f15353;
        }
      }

      .dleage-time {
        font-size: 13px;
        line-height: 13px;
        color: #aaaab3;

        p {
          color: #3b3b4a;
        }
      }
    }
  }

  .pledge-bottom {
    box-sizing: border-box;
    padding-bottom: 28px;
  }
}
</style>